package com.prpat;

import java.io.Serializable;

class Message implements Serializable
{
	private static final long serialVersionUID = -1576273334706671802L;
	
	private String source;
	private String message;
	public Range range;
	private int type;
	
	public static final int REQUEST = 1;
	public static final int REPLY   = 2;
	
	Message(String msg, Range rng, int tp)
	{
		source = River.LOCAL_IP;
		message = msg;
		range = rng;
		type = tp;
	}
	
	Message(Message toCopy)
	{
		source = toCopy.getSource();
		message = toCopy.getMessage();
		range = toCopy.getRange();
		type = toCopy.getType();
	}
	
	public String toString()
	{
		return message + " " + range.toString();
	}

	public String getSource() {
		return source;
	}

	public String getMessage() {
		return message;
	}

	public Range getRange() {
		return range;
	}

	public int getType() {
		return type;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public void setMessage(String message) {
		this.message = message;
	}

	public void setType(int type) {
		this.type = type;
	}

}
